@inject('appRepository', 'App\Repositories\AppRepository')
@php
    $banner = $appRepository->getContentByColumn('ContentPicture',5,'首页','BANNER')
@endphp
@extends('layouts.app',['navShow'=>true])
@section('title','首页')
@section('content')
    <main role="main">
        @if($banner&&count($banner))
            <div id="myCarousel" class="carousel slide" data-ride="carousel">
                <ol class="carousel-indicators">
                    @foreach($banner as$key=> $item)
                        <li data-target="#myCarousel" data-slide-to="0" class="{{$key===0?'active':''}}"></li>
                    @endforeach
                </ol>
                <div class="carousel-inner">
                    @foreach($banner as $key=>$item)
                        <div class="carousel-item {{$key===0?'active':''}}">
                            <img class="img-fluid"
                                 src="{{$item->content_detail->assets_path}}"
                                 alt="First slide">
                            <div class="container">
                                <div class="carousel-caption text-left">
                                    <h1>{{$item->title}}</h1>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
                <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>

    @endif
    <!-- Marketing messaging and featurettes
        ================================================== -->
        <!-- Wrap the rest of the page in another container to center all the content. -->

        <div class="container marketing">

            <!-- Three columns of text below the carousel -->
            <div class="row py-5  pic-box">
                @foreach($appRepository->getContentByColumn('ContentPicture',5,'首页','上部广告位') as $item)
                    <div class="col d-flex justify-content-center">
                        <a href="{{$item->content_detail->point_url}}">
                            <img class="img-fluid" src="{{$item->content_detail->assets_path}}" alt=""></a>
                    </div>
                @endforeach
            </div><!-- /.row -->


            <div class="container px-0">
                <div class="row">
                    @php
                        $contents = $appRepository->getContentByColumn('ContentBlog',10,'首页','自主招生最新动态')
                    @endphp
                    @if($contents)
                        <div class="col-6 news-box">
                            <div class="d-flex justify-content-between  align-content-center">
                                <p class="news-title">自主招生最新动态</p>
                                <a href="{{url('picture-list',['name'=>'自主招生最新动态'])}}" class="">更多 <i class="fa fa-angle-right"></i></a>
                            </div>
                            <div class="news-body p-4">
                                @foreach($contents as $item)
                                    <a class="text-o" href="{{url('content',['contentId'=>$item->id])}}">【{{Carbon\Carbon::parse($item->created_at)->toDateString()}}】
                                        {{$item->title}}</a>
                                @endforeach
                            </div>
                        </div>
                    @endif
                    @php
                        $contents = $appRepository->getContentByColumn('ContentBlog',10,'首页','特色发展资讯')
                    @endphp
                    @if($contents&&count($contents))
                        <div class="col-6 news-box">
                            <div class="d-flex justify-content-between  align-content-center">
                                <p class="news-title">特色发展资讯</p>
                                <a href="{{url('list',['name'=>'特色发展资讯'])}}" class="">
                                    更多 <i class="fa fa-angle-right"></i></a>
                            </div>
                            <div class="news-body p-4">
                                @foreach($contents as $item)
                                    <a class="text-o" href="{{url('content',['contentId'=>$item->id])}}">【{{Carbon\Carbon::parse($item->created_at)->toDateString()}}】
                                        {{$item->title}}</a>
                                @endforeach
                            </div>
                        </div>
                    @endif
                </div>
            </div>
            @php
                $courses = $appRepository->getRecommendCourses()
            @endphp
            @if($courses&&count($courses))
                <div class="row mt-4">
                    <div class="col news-box">
                        <div class="d-flex justify-content-between  align-content-center">
                            <p class="news-title">推荐教学视频</p>
                            <a href="{{url('/course/list')}}" class="">查看更多 <i class="fa fa-angle-right"></i></a>
                        </div>
                    </div>
                </div>
                <div class="row course-box">
                    @foreach($courses as $item)
                        <div class="col-6 mb-3">
                            <a href="/course/{{$item->id}}/course-detail">
                                <div class="col p-0">
                                    <img class="img-fluid" src="{{$item->image_path}}" alt="">
                                    <div class="media__body">
                                        <img src="{{asset('/img/播放.png')}}" alt="">
                                    </div>
                                </div>
                            </a>
                            <div class="d-flex course-body justify-content-between m-2">
                                <a href="/course/{{$item->id}}/course-detail" class=""> {{$item->name}}</a>
                            </div>
                        </div>
                    @endforeach
                </div>
            @endif
            <div class="row mt-4">
                <div class="col news-box">
                    <div class="d-flex justify-content-between  align-content-center">
                        <p class="news-title">培优策特色发展方案</p>
                    </div>
                </div>
            </div>
            <div class="row programme-box">
                @php
                    $contents = $appRepository->getContentByColumn('ContentPicture',1,'首页','需求侧方案')
                @endphp

                @if($contents && count($contents))
                    <div class="col-4">
                        <p class="ml-2 programme-title">需求侧方案 <span>Demand</span></p>
                        @foreach($contents as $item)
                            <a href="{{$item->content_detail->point_url}}">
                                <div  class="col p-0  mr-3 programme-body">
                                    <img class="img-fluid" src="{{$item->content_detail->assets_path}}" alt="">
                                    <span class="programme-main-desc">{{$item->title}}</span>
                                </div>
                            </a>
                        @endforeach
                    </div>
                @endif
                @php
                    $contents = $appRepository->getContentByColumn('ContentPicture',3,'首页','供给侧方案')
                @endphp
                @if($contents && count($contents))
                <div class="col">
                    <p class="ml-2 programme-title">供给侧方案 <span>Provision</span></p>
                    <div class="row programme-body">
                        @foreach($contents as $item)
                            <div class="col p-0  mr-3">
                                <a href="{{$item->content_detail->point_url}}">
                                    <img class="img-fluid" src="{{$item->content_detail->assets_path}}" alt="">
                                    <span class="programme-desc"> {{$item->title}}</span>
                                </a>
                            </div>
                        @endforeach
                    </div>
                </div>
                @endif
            </div>

            @php
                $teachers = $appRepository->getRecommendTeachers()
            @endphp
            @if($teachers)
                <div class="row mt-4 ">
                    <div class="col news-box">
                        <div class="d-flex justify-content-between  align-content-center">
                            <p class="news-title">培优策师资</p>
                            <a href="{{url('more-teacher')}}" class="">更多名师 <i class="fa fa-angle-right"></i></a>
                        </div>
                    </div>
                </div>
                <div class="row teachers-box p-3">
                    @foreach($teachers as $item)
                        <div class="col-2 teacher-body m-3 p-0">
                            <img class="img-fluid" src="{{$item->photo}}" alt="">
                            <span class="media-item">
                        <div class="title">
                            <p class="call">{{$item->name}} </p>
                            <p class="name">{{$item->getCoursesView()}}</p>
                        </div>
                        <p class="desc">
                            {{$item->profile}}
                        </p>
                    </span>
                        </div>
                    @endforeach
                </div>
            @endif
            {{--<div class="row mt-4">--}}
                {{--<div class="advert-box col">--}}
                    {{--<p class="title py-4">--}}
                        {{--以学生为本，以特色育人--}}
                    {{--</p>--}}
                    {{--<p class="desc">--}}
                        {{--教育以育人为本，就是要全面贯彻党的的教育方针，始终把培育人才作为学校的根本任务。<br>--}}
                        {{--具体地说，育人为本，必需坚持德育为先；育人为本，必需增进学生全面发展；育人为本，必需关注学生的心里健康和健全人格的形成。<br>--}}
                        {{--<br>--}}
                        {{--以学生为主体，就是以学生发展为核心，重视学生的个性差异，充分尊敬、关怀、理解和信赖每一个学生，因材施教，增进学生平等、协调、自主发展，为学生终身发展奠基。<br>--}}
                        {{--以学生为主体，要引导学生参与学校管理；以学生为主体，要引导学生参与教学过程的各个环节；以学生为主体，要建立教育民主的思想，建立平等融洽的师生关系。--}}
                    {{--</p>--}}
                {{--</div>--}}
            {{--</div>--}}
            {{--<div class="row  mt-4">--}}
                {{--<div class="adv-box col py-2">--}}
                    {{--<p class="title">--}}
                        {{--培优策 愿景与使命--}}
                    {{--</p>--}}
                    {{--<div class="col mt-3 px-0">--}}
                        {{--<div class="row">--}}
                            {{--<div class="col pl-0">--}}
                                {{--<div class="media adv-left">--}}
                                    {{--<img class="mr-3" src="{{asset('/img/愿景.png')}}" alt="Generic placeholder image">--}}
                                    {{--<div class="media-body">--}}
                                        {{--<h5 class="mt-2 mb-1 media-title">愿景 <span class="sub-title">Vision</span></h5>--}}
                                        {{--为每所学校提供因地制宜的资源，为每位学子提供特长发展的土壤--}}
                                    {{--</div>--}}
                                {{--</div>--}}
                            {{--</div>--}}
                            {{--<div class="col px-0">--}}
                                {{--<div class="media adv-right">--}}
                                    {{--<img class="mr-3" src="{{asset('/img/使命.png')}}" alt="Generic placeholder image">--}}
                                    {{--<div class="media-body">--}}
                                        {{--<h5 class="mt-2 mb-1 media-title">使命 <span class="sub-title">Mission</span></h5>--}}
                                        {{--优质师资的联结者，特色课程的打磨者，特色培训的创新者--}}
                                    {{--</div>--}}
                                {{--</div>--}}
                            {{--</div>--}}
                        {{--</div>--}}
                    {{--</div>--}}
                {{--</div>--}}
            {{--</div>--}}
        </div><!-- /.container -->

    </main>
@endsection
